package net.xiangcaowuyu.simplemybatis.controller;

import net.xiangcaowuyu.simplemybatis.entity.Userone;
import net.xiangcaowuyu.simplemybatis.entity.Usertwo;
import net.xiangcaowuyu.simplemybatis.mapper.one.UseroneMapper;
import net.xiangcaowuyu.simplemybatis.mapper.two.UsertwoMapper;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;

/**
 * @author laughing
 * @date 2020/9/30
 * @site https://www.xiangcaowuyu.net
 */
@RestController
public class MyBatisController {

    @Resource
    UseroneMapper useroneMapper;

    @Resource
    UsertwoMapper usertwoMapper;

    @RequestMapping("/one")
    public Userone userone(){
        return useroneMapper.selectByPrimaryKey(1L);
    }

    @RequestMapping("/two")
    public Usertwo usertwo(){
        return usertwoMapper.selectByPrimaryKey(1L);
    }

}
